<%--
 *  File:    ColumnAutoUpdateDetail.jsp
 *  @Author: Jamesli 
 *  Date:    2011/01/21
 *
 *  Copyright (C) 2000 - 2011 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>


<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.ColumnAutoUpdateDetail");  
%>

<% //--------------------------------------  variant and initialization --%>
<%
  	String strModuleName = "COM";
	String privilegeCode = "Z0833";
	String contextPath = request.getContextPath();
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>ColumnAutoUpdateDetail</title>
<PageFlow:CheckPageFlow pageName="p_columnautoupdatedetail"/>
<%@ include file="/inc/InitEdit.inc" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%= contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%= contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%= contextPath%>/js/ScriptLib.js"></script>

<% //--------------------------------------  output variant from pageflow --%>
<%
  	Vector details = (Vector)pageContext.getAttribute("details");
  	if(details == null) details = new Vector();	
%>
<script>
function page_delete()
{
	if(isNullChecked(cform.deleteids))
	{
	  alert("<%=message.getMessageDesc("PLEASE_SELECT")%>");
	  return;
	}
	
  	document.cform.actionname.value = "delete";
  	cform.target = "_self";
  	isRunning = true;
  	document.cform.submit();
}

function page_add()
{
	if(!checkForm(document.cform)) return;
	//return;
    var advancedfilterid = document.cform.advancedfilterid.value;
	if(page_checkExists()) return;
  document.cform.actionname.value = "add";
  cform.target = "_self";
  isRunning = true;
  document.cform.submit();
}

function page_checkExists(){
	var rownum = document.cform.rownum.value;
	var advancedfilterid = document.cform.advancedfilterid.value;
	for(var i = 1 ; i < rownum ; i++ ){
		if(advancedfilterid == eval('document.cform.advancedfilterid' + i).value){
			alert("<%= message.getMessageDesc("A_ALREADY_EXISTS",label.getLabelName("L_Product"))%>");
			return true;
		}
	}
	return false;
}
</script>
</head>
<body>

	<% //--------------------------------------  hidden form variant --%>
	<form name="cform" method="post" action="<%= contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_columnautoupdatedetail">
    <input type="hidden" name="actionname">   
	<custom:hidden property="columnautoupdateid"/>
	<custom:hidden property="analyzecodeid"/>
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr> 
			<td colspan="2" class="summary_top"></td>
		</tr>
		<tr> 
	 		<td colspan="2"><img src="<%= contextPath%>/images/<%= strLanguageCode %>/quote.gif" width="16" height="11"> 
			<%= label.getLabelName("L_Detail") + label.getLabelName("L_Colon") %></td>
		</tr>
	</table>
	<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
          	<tr class="deepblue-left"> 
            	<td width="40" class="title_center">&nbsp;</td>
            	<td class="title_center" width="300"><%= "条件" %><font color="red">*</font></td>
            	<td class="title_center" width="*"><%= label.getLabelName("L_Comments") %></td>
          	</tr>
          	
          	<%
            	int i = 0;
            	String strClassType = new String("");   
          	%>
          	<logic:iterate id="onerow" collection="<%= details %>">                      
          	<%
            	String strIsChecked = new String("");
            	if(i%2 == 1)
            	{
              		strClassType = "td-listrom";
            	}else{                    
              		strClassType = "none";
            	}             
            	i++;     
           	%>
          	<tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"  class="<%=JspHelper.filterNull( strClassType )%>"> 
            	<td class="td_center">
            		<custom:checkbox property="columnautoupdatedetailid" name="onerow" styleClass="checkbox" changedName="deleteids"/>
            	</td>
            	<td class="td_center"><custom:write property="filtername" name="onerow" nbsp="true"/></td>
            	<custom:hidden property="advancedfilterid" name="onerow" colIndex="<%=new Integer(i) %>"/>
            	<td class="td_center"><custom:write property="comments" name="onerow" nbsp="true"/></td>
          	</tr>
          	</logic:iterate>         
          	<%
          		String temp = i + 1 + "";
          	%>
          	<custom:hidden property="rownum" value="<%=temp %>"/>

          	<tr> 
          		<TD>&nbsp;</TD>
              	<TD class="td_center"><custom:select optionInnerTextKey="filtername" optionsName="allconditions" optionValueKey="advancedfilterid" property="advancedfilterid" command="notnull" defaultValue="-------------" defaultValueCost=""/></td>
              	<TD class="td_center"><custom:text property="comments" size="50"/></td>
          	</tr>
        	</table>
        	
        	<% //--------------------------------------  page operation button --%>
      		<table width="100%" cellspacing="0" cellpadding="0">
        	<tr> 
          		<td class="summary_top"></td>
        	</tr>
        	<tr> 
          		<td class="td_center">
          			<a onclick="page_add()"><custom:button type="1" label="L_Add" imgsrc="add.gif" border="0" style="width:60"/></a>
          			<a onclick="page_delete()"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
          		</td>
        	</tr>
      		</table>
</form>
</body>
</html>